#pragma once

#include "Poco/Timespan.h"
#include "utility.h"

using Poco::Timespan;

class CPopupItem :public CVerticalLayoutUI
{
public:
	CPopupItem();
	virtual ~CPopupItem(){}
	void SetCall(Call_PTR& ptrCall);
	void SetTextAndColor(Timespan nWarn1Seconds, Timespan nWarn2Seconds, Timespan nTimeoutSeconds);
	void SetText3(CString str);
	Call_PTR m_ptrCall;

private:
	CLabelUI* m_pLab1;
	CTextUI* m_pLab2;
	CLabelUI* m_pLab3;
};


class CPopupCallDlg :
	public WindowImplBase
{
public:
	CPopupCallDlg();
	CPopupCallDlg(Call_PTR& ptrCall);
	virtual ~CPopupCallDlg();

	LPCTSTR GetWindowClassName() const { return _T("CPopupCallDlg"); }
	virtual CDuiString GetSkinFile() { return _T("popupCall.xml"); }
	virtual CDuiString GetSkinFolder() { return  _T("skin"); }
	virtual LRESULT ResponseDefaultKeyEvent(WPARAM wParam);
	virtual LRESULT OnNcActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled);
	virtual LRESULT HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	virtual CControlUI* CreateControl(LPCTSTR pstrClass);
	virtual void OnFinalMessage(HWND hWnd);
	virtual void InitWindow();

	void NewCall(Call_PTR& ptrCall);
private:
	Call_PTR		m_ptrCall;
	CLabelUI*		m_pLabTitle = nullptr;
	CPopupItem*		m_Item1 = nullptr;
	CPopupItem*		m_Item2 = nullptr;
	CPopupItem*		m_Item3 = nullptr;
	CPopupItem*		m_Item4 = nullptr;
	CPopupItem*		m_Item5 = nullptr;
};

